package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"
	"ssadmin/internal/admin/apis"
)

func init() {
	AuthRouters = append(AuthRouters, registerRegisterRouter)
}

func registerRegisterRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.Register{}
	apiUser := apis.User{}
	none := v1.Group("/api/auth")
	{
		none.POST("/register", api.Insert)
		none.GET("/verify-code/get", api.SendVerifyCode)
		none.GET("/user-exist", api.ExistByUsername)
		none.POST("/reset-password-by-phone", apiUser.CheckCode)
		none.GET("/phone-by-code/get", api.GetPhoneByCode)
	}
}
